Skip to content

E13 Configuring Apache for Distributing Resources

Back to the Course Schedule

Back to the Material: Servers and End Devices

These videos are still in Finnish

Video: Instructions for E13

Topology

In this exercise...

  1. Your server is Lubuntu VM (!a)
  2. Lubuntu VM acts as a HTTP -server
  3. Test and modify its settings with another Lubuntu VM

!a

Verifying Lubuntu - Apache instance

Check that the Apache2 -service is running.

service apache2 status

lubuntu@lubuntu-virtualbox:~$ service apache2 status
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-10-13 14:47:57 EEST; 5min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 654 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 688 (apache2)
      Tasks: 55 (limit: 1070)
     Memory: 7.7M
     CGroup: /system.slice/apache2.service
             ├─688 /usr/sbin/apache2 -k start
             ├─689 /usr/sbin/apache2 -k start
             └─690 /usr/sbin/apache2 -k start

loka 13 14:47:57 lubuntu-virtualbox systemd[1]: Starting The Apache HTTP Server...
loka 13 14:47:57 lubuntu-virtualbox apachectl[673]: AH00558: apache2: Could not reliably >
loka 13 14:47:57 lubuntu-virtualbox systemd[1]: Started The Apache HTTP Server.

Break with pressing q

Test on the local machine with wget that the webserver is working (from the command line)

wget http://127.0.0.1/

lubuntu@lubuntu-virtualbox:~$ wget http://127.0.0.1/
--2020-10-13 14:55:12--  http://127.0.0.1/
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11010 (11K) [text/html]
Saving to: ‘index.html.1’

index.html.1           100%[==========================>]  10,75K  --.-KB/s    in 0s      

2020-10-13 14:55:13 (313 MB/s) - ‘index.html.1’ saved [11010/11010]

Inspect the retrieved index.html -file.

more index.html

The server is equipped with a basic index.html file.

lubuntu@lubuntu-virtualbox:~$ more index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml
1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <!--
    Modified from the Debian original for Ubuntu
    Last updated: 2016-11-16
    See: https://launchpad.net/bugs/1288690
  -->
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Data Networks - Apache2 Ubuntu Default Page: It works</title>
    <style type="text/css" media="screen">
  * {
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 0px;
  }

  body, html {
    padding: 3px 3px 3px 3px;
    ...........
    ...........
    ...........

Break with pressing q

Adjusting HTML files on the server

Editing

Two different choices:

  1. You can edit the file in /var/www/html/index.html

    • sudo nano /var/www/html/index.html and use the default credentials for Lubuntu VM
    • edit the file and save with with CTRL+X and Y
      • Edit could contain something related to your student account e.g. student number etc
  2. You can move your Web Techniques -course webpages to your Lubuntu virtual machine

Bug: Step 2 might cause problems

Easiest way is to copy&paste the files one at a time through the clipboard (leikepöytä) to the virtual machine

earier instructions were... these are under investigation on week 48

  • Move the Lubuntu VM to your home network (change the adapter to bridged)
  • Use WinSCP to connect to the IP address gained by the Lubuntu VM

Verifying functionality through desktop

Check your edits with the browser of the client Lubuntu VM. * Open browser * Browse by typing in the URL field: http://Lubuntu VM server>

Example

!a

Screencapture your browser and document the screenshot into your repository.

Wireshark HTTP GET

Attach Lubuntu Wireshark along the path between the HTTP client and the HTTP server.

Wireshark the HTTP traffic (you can filter it by writing http into the filter field).

  1. Investigate & Screenshot the packet capture
    • HTTP GET
    • user-agent
  2. What do the fields contain?

Document it to your repository.

Back to the Schedule?

Back to the Course Schedule


License

This course and its materials are written by Karo Saharinen and licenced by Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0) license.

Creative Commons -licence